#include "playerwindow.h"
#include "loginwindow.h"
#include <QApplication>
#include <QSettings>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    //获取user.in配置文件中的用户名和密码
    QSettings* set = new QSettings("user.ini",QSettings::IniFormat);

    QString userName = set->value("/user/username").toString();
    QString passWord = set->value("/user/password").toString();

    if(userName.isEmpty() && passWord.isEmpty())
    {
        //不存在，跳转 登录窗口
        //更改启动窗口，从登录窗口启动
        LoginWindow* w = new LoginWindow;

    }else {
        //如果存在，跳转 音乐播放器窗口
        PlayerWindow* p = new PlayerWindow(userName);
        p->show();
}

    //LoginWindow w;

    return a.exec();
}
